package com.ss.android.article.base.feature.splash;

import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.os.Bundle;
import android.os.Message;
import android.support.annotation.NonNull;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.LinearInterpolator;
import android.view.animation.RotateAnimation;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;

import com.bytedance.article.common.c.TTUtils;
import com.bytedance.common.utility.Logger;
import com.bytedance.common.utility.collection.WeakHandler;
import com.bytedance.common.utility.collection.WeakHandler.Callback;
import com.ss.android.article.base.app.AppData;
import com.ss.android.article.base.feature.video.IMediaViewLayout.CtrlFlag;
import com.ss.android.article.base.feature.video.IVideoController;
import com.ss.android.article.base.feature.video.IVideoController.ISplashAdListener;
import com.ss.android.article.browser.R;
import com.ss.android.article.common.e.VideoControllerSupplierProxy;
import com.ss.android.b.AdManager;
import com.ss.android.b.AdManager.b;
import com.ss.android.b.a.m;
import com.ss.android.common.ad.MobAdClickCombiner;
import com.ss.android.common.app.permission.PermissionsManager;
import com.ss.android.common.app.permission.PermissionsResultAction;
import com.ss.android.common.dialog.AlertDialog;
import com.ss.android.common.util.ImmersedStatusBarHelper;
import com.ss.android.common.util.NetworkUtils;
import com.ss.android.common.util.ToolUtils;
import com.ss.android.newmedia.BaseAppData;
import com.ss.android.newmedia.BaseApplication;
import com.ss.android.newmedia.activity.BaseActivity;
import com.ss.android.newmedia.activity.browser.BrowserActivity;
import com.ss.android.newmedia.util.AppUtil;

import org.json.JSONException;
import org.json.JSONObject;

import java.util.EnumSet;
import java.util.List;

import pl.droidsonroids.gif.h;

public class SplashAdActivity extends BaseActivity implements Callback {
    int a = 0;
    boolean b = false;
    WeakHandler mWeakHandler = new WeakHandler(((Callback) this));
    private IVideoController mVideoController;
    private ISplashAdListener mSplashAdListener;
    private FrameLayout mSplashVideoFrame;
    private ViewGroup mSplashVideoLayout;
    private long h = -1;
    private boolean i;
    private boolean j = false;
    private boolean k = false;
    private boolean l = false;
    private RelativeLayout mRootLayout;
    private ImageView mSplashView;
    private ImageView mBannerView;
    private ImageView mAdClickSmall;
    private LinearLayout mAdClick;
    private View mAdIgnore;
    private ImageView mAdSkipLoading;

    public static void a(Context context, boolean arg22) {
        boolean v2_2;
        if (!arg22 && (com.ss.android.newmedia.util.f.b())) {
            BaseAppData baseAppData = BaseAppData.inst();
            Logger.d("SplashAdActivity", "shouldShow " + baseAppData.shouldShow());
            if ((baseAppData.shouldShow()) && context != null) {
                AdManager v6 = AdManager.getInstance(context);
                b v2_1 = v6.a(false, com.ss.android.b.bb.a().c());
                if (v2_1 == null) {
                    label_124:
                    v2_2 = false;
                } else if (v2_1.q == 0) {
                    v2_2 = v6.a(v2_1.a);
                } else if (v2_1.q == 3) {
                    if ((v6.a(v2_1.a)) && (v6.a(v2_1.r))) {
                        v2_2 = true;
                    } else {
                        v2_2 = false;
                    }
                } else {
                    if (v2_1.q != 2) {
                        v2_2 = false;
                    } else {
                        v2_2 = v6.a(v2_1.r);
                    }
                }

                long v8 = System.currentTimeMillis();
                long v10 = com.ss.android.b.bb.a().c();
                long v12 = com.ss.android.b.bb.a().b();
                long v4 = com.ss.android.b.bb.a().e().longValue();
                AdManager.c$c v3 = AdManager.getInstance(v6.mContext).g;
                long v14 = v6.g.c.leaveInterval;
                long v16 = v3.c.interval;
                long v18 = v3.c.splashInterval;
                int v7 = v3.c.showMode;
                boolean v20 = NetworkUtils.isWifi(v6.mContext);
                int v5 = v8 - v4 > v16 ? 1 : 0;
                int v4_1 = v8 - v12 > v18 ? 1 : 0;
                int v3_1 = v8 - v10 > v14 ? 1 : 0;
                v3_1 = v7 != 0 && v7 != 2 || (!v20 || v5 == 0 || v4_1 == 0 || v3_1 == 0) ? 0 : 1;
                v4_1 = v3_1 == 0 || !v6.d() ? 0 : 1;
                if (!v2_2 && v4_1 == 0) {
                    return;
                }

                Intent intent = new Intent("com.ss.android.article.base.feature.splash.SplashAdActivity" + AppData.getInstance().getAppContext().getAid());
                int showTypeCapability = v2_2 ? 1 : 0;
                if (v4_1 != 0) {
                    showTypeCapability |= 2;
                }

                intent.putExtra("show_type_capability", showTypeCapability);
                intent.putExtra("from_app_start", false);
                List<ResolveInfo> resolveInfoList = context.getPackageManager().queryIntentActivities(intent, 0);
                if (resolveInfoList != null && !resolveInfoList.isEmpty()) {
                    context.startActivity(intent);
                }
            }
        }
    }

    private void a(@NonNull final AdManager.b arg11, boolean arg12, final JSONObject arg13) {
        final JSONObject v0_4;
        boolean v0 = false;
        this.l = true;
        this.mWeakHandler.removeMessages(104);
        this.mWeakHandler.removeMessages(102);
        this.mWeakHandler.removeMessages(103);
        try {
            if (!TextUtils.isEmpty(arg11.openUrl)) {
                v0 = android.support.design.a.a(this, arg11.openUrl, arg11.logExtra, arg11.id, arg11.p);
                if ((v0) && (arg12) && this.mVideoController != null) {
                    this.mVideoController.pauseVideo();
                }
            }

            if (v0) {
                this.finish();
                return;
            }

            if (!TextUtils.isEmpty(arg11.webUrl)) {
//                goto label_39;
            } else {
                this.a(4000);
                return;
            }

            int v0_2 = 2;
            if (v0_2 == arg11.adType && (TTUtils.isValidUrl(arg11.webUrl))) {
                Intent intent = new Intent(this, BrowserActivity.class);
                intent.setData(Uri.parse(arg11.webUrl));
                if (!android.support.design.a.isTextEmpty(arg11.webTitle)) {
                    intent.putExtra("title", arg11.webTitle);
                }

                intent.putExtra("orientation", arg11.orientation);
                intent.putExtra("ad_id", arg11.id);
                intent.putExtra("bundle_download_app_log_extra", arg11.logExtra);
                intent.putExtra("bundle_forbid_jump", arg11.p);
                this.startActivityForResult(intent, 101);
                if (!arg12) {
                    return;
                }

                if (this.mVideoController == null) {
                    return;
                }

                this.mVideoController.pauseVideo();
                return;
            }

            if (1 != arg11.adType) {
                this.mWeakHandler.sendEmptyMessage(102);
                return;
            }

            if (android.support.design.a.isTextEmpty(arg11.pkg)) {
//                goto label_91;
            } else if (!ToolUtils.isAppInstalled(this, arg11.pkg)) {
//                goto label_91;
            } else {
                try {
                    this.startActivity(ToolUtils.getLaunchIntentForPackage(((Context) this), arg11.pkg));
                    this.finish();
                    return;
                } catch (Exception v0_1) {
                }
            }

            if (android.support.design.a.isTextEmpty(arg11.alertText)) {
                v0_4 = new JSONObject();
                JSONObject v1 = new JSONObject();
                try {
                    v1.put("url", arg11.downloadUrl);
                    v1.put("ad_id", arg11.id);
                    v0_4.put("label", "splash_ad");
                    v0_4.put("ext_json", v1);
                } catch (JSONException jsonException) {
                    jsonException.printStackTrace();
                }
            } else {
                AlertDialog.Builder v0_5 = com.ss.android.j.b.createDialogBuilder(((Context) this));
                v0_5.setMessage(arg11.alertText);
                v0_5.setCancelable(false);
                v0_5.setPositiveButton(com.ss.android.article.browser.R.string.splash_app_download_confirm,
                        new DialogInterface.OnClickListener() {

                            public final void onClick(DialogInterface dialogInterface, int arg12) {
                                final JSONObject v0 = new JSONObject();
                                JSONObject v1 = new JSONObject();
                                try {
                                    v1.put("url", arg11.downloadUrl);
                                    v1.put("ad_id", arg11.id);
                                    v0.put("label", "splash_ad");
                                    v0.put("ext_json", v1);
                                } catch (JSONException v1_1) {
                                }

                                PermissionsManager.getInstance()
                                        .requestPermission(SplashAdActivity.this, new String[]{"android.permission.WRITE_EXTERNAL_STORAGE"},
                                                new PermissionsResultAction() {
                                                    public final void onGranted() {
                                                        AppUtil.a(arg11.downloadUrl,
                                                                arg11.appName,
                                                                SplashAdActivity.this,
                                                                v0);
                                                        SplashAdActivity.this.mWeakHandler.sendEmptyMessage(103);
                                                    }

                                                    public final void onDenied(String arg1) {
                                                    }
                                                });
                                MobAdClickCombiner.onAdEvent(SplashAdActivity.this, "splash_ad",
                                        "download_confirm",
                                        arg11.id,
                                        0,
                                        arg13, 3);
                            }
                        });
                v0_5.setNegativeButton(com.ss.android.article.browser.R.string.splash_app_download_cancel,
                        new DialogInterface.OnClickListener() {

                            public final void onClick(DialogInterface dialogInterface, int arg12) {
                                SplashAdActivity.this.mWeakHandler.sendEmptyMessage(103);
                                MobAdClickCombiner.onAdEvent(SplashAdActivity.this,
                                        "splash_ad",
                                        "download_cancel",
                                        arg11.id,
                                        0,
                                        arg13, 3);
                            }
                        });
                v0_5.create().show();
                return;
            }

            PermissionsManager
                    .getInstance()
                    .requestPermission(this, new String[]{"android.permission.WRITE_EXTERNAL_STORAGE"},
                            new PermissionsResultAction() {

                                public final void onGranted() {
                                    AppUtil.a(arg11.downloadUrl, arg11.appName, SplashAdActivity.this, v0_4);
                                    SplashAdActivity.this.mWeakHandler.sendEmptyMessage(103);
                                }

                                public final void onDenied(String arg1) {
                                }
                            });
            MobAdClickCombiner.onAdEvent(this, "splash_ad", "download_confirm", arg11.id, 0, arg13, 3);
        } catch (Exception exception) {
            android.support.design.a.a(exception);
        }
    }

    final void a(long arg4) {
        int v2 = 103;
        int v1 = 102;
        if (this.i) {
            this.mWeakHandler.removeMessages(v1);
            this.mWeakHandler.sendMessageDelayed(this.mWeakHandler.obtainMessage(v1), arg4);
        } else {
            this.mWeakHandler.removeMessages(v2);
            this.mWeakHandler.sendMessageDelayed(this.mWeakHandler.obtainMessage(v2), arg4);
        }
    }

    private void a(String arg12, String arg13, long arg14, JSONObject arg16) {
        MobAdClickCombiner.onAdEvent(this, arg12, arg13, arg14, 0, arg16, 3);
    }

    final void a() {
        if (!this.l) {
            if (this.j) {
                this.a(0);
            } else {
                this.k = true;
            }
        }
    }

    protected final void a(AdManager.b arg11) {
        JSONObject v8;
        try {
            v8 = new JSONObject();
            v8.put("show_time", arg11.b());
            if (android.support.design.a.isTextEmpty(arg11.logExtra)) {
//                goto label_11;
            } else {
                v8.put("log_extra", arg11.logExtra);
            }
        } catch (Exception v0) {
            v8 = null;
        }

        label_11:
        MobAdClickCombiner.onAdEvent(this, "splash_ad", "skip", arg11.id, 0, v8, 3);
        this.l = true;
        this.mWeakHandler.removeMessages(104);
        this.mAdIgnore.findViewById(com.ss.android.article.browser.R.id.skip_real).setVisibility(View.INVISIBLE);
        this.mAdSkipLoading.setVisibility(View.VISIBLE);
        RotateAnimation v0_1 = new RotateAnimation(0f, 359f, 1, 0.5f, 1, 0.5f);
        v0_1.setDuration(800);
        v0_1.setRepeatCount(-1);
        v0_1.setRepeatMode(1);
        v0_1.setInterpolator(new LinearInterpolator());
        this.mAdSkipLoading.startAnimation(((Animation) v0_1));
        this.a(0);
    }

    protected final void a(AdManager.b arg12, boolean arg13) {
        int v0_1;
        String v1;
        JSONObject v8;
        if (!this.l) {
            try {
                v8 = new JSONObject();
                v8.put("show_time", arg12.b());
                v1 = "area";
                if (arg13) {
                    v0_1 = 0;
                } else {
                    v0_1 = 1;
                }

                label_12:
                v8.put(v1, v0_1);
                if (android.support.design.a.isTextEmpty(arg12.logExtra)) {
//                    goto label_19;
                } else {
                    v8.put("log_extra", arg12.logExtra);
                }
            } catch (Exception v0) {
                label_31:
                v8 = null;
            }

            label_19:
            MobAdClickCombiner.onAdEvent(this, "splash_ad", "click", arg12.id, 0, v8, 3);
            this.a(arg12, false, v8);
        }
    }

    private boolean b(final b arg23) {
        boolean v4;
        Logger.d("SplashAdActivity", "show Video splash ad");
        final m v20 = arg23.r;
        if (v20 == null) {
            v4 = false;
            return v4;
        }

        this.mSplashVideoLayout.setVisibility(View.VISIBLE);
        this.mVideoController = VideoControllerSupplierProxy.getInstance().createVideoControllerDirectly(this, this.mSplashVideoFrame, false, EnumSet.of(CtrlFlag.hideCloseBtn, CtrlFlag.fixedSize));
        JSONObject v21 = new JSONObject();
        try {
            v21.put("log_extra", arg23.logExtra);
        } catch (JSONException v4_1) {
            v4_1.printStackTrace();
        }

        this.mSplashAdListener = new ISplashAdListener() {

            public final void onComplete(long arg5, int arg7) {
                SplashAdActivity.this.b = true;
                AppUtil.a(v20.c, BaseApplication.getApplication());
                SplashAdActivity.this.a(500);
            }

            public final void onError(long arg5, int arg7) {
                SplashAdActivity.this.a(500);
            }

            public final void onSkip(long arg3, int arg5) {
                SplashAdActivity.this.a = 2;
                SplashAdActivity.this.a(arg23);
            }

            public final void onTimeOut() {
                SplashAdActivity.this.a(500);
            }

            public final void onVideoClick(long arg4, int arg6) {
                AppUtil.a(v20.d, BaseApplication.getApplication());
                SplashAdActivity.this.b(arg23, true);
            }
        };
        this.mVideoController.setSplashAdListener(this.mSplashAdListener);
        v4 = false;
        if (arg23.q == 3) {
            ViewGroup.LayoutParams v4_2 = this.mSplashVideoLayout.getLayoutParams();
            ((RelativeLayout.LayoutParams) v4_2).height = -1;
            ((RelativeLayout.LayoutParams) v4_2).width = -1;
            ((RelativeLayout.LayoutParams) v4_2).addRule(2, R.id.banner_view);
            this.mSplashVideoLayout.setLayoutParams(v4_2);
            DisplayMetrics v12 = this.getResources().getDisplayMetrics();
            int v17 = v12.heightPixels - AdManager.getInstance(((Context) this)).e() - (((int) this.getResources().getDimension(R.dimen.splash_banner_margin_bottom)));
            int v11 = arg23.a.mHeight;
            int v13 = arg23.r.videoHeight;
            if (v11 != 0 && v13 != 0) {
                v4 = AdManager.getInstance(((Context) this)).tryShowImageSplash(this, arg23, this.mBannerView, this.mSplashView, null, null);
                v13 = ((int) ((((float) v13)) * ((((float) v17)) / (((float) v11)))));
                v4 = !this.mVideoController.playSplashUrl(v20.f, v20.e, null, null, arg23.id, v12.widthPixels, v13, v20.a, null, arg23.logExtra, (v17 - v13) / 2, false, false) || !v4 ? false : true;
                View v6 = this.mAdIgnore;
                int v5 = arg23.n == 1 ? View.VISIBLE : View.GONE;
                v6.setVisibility(v5);
                this.mAdIgnore.setOnClickListener(new View.OnClickListener() {

                    public final void onClick(View arg3) {
                        SplashAdActivity.this.a = 2;
                        SplashAdActivity.this.a(arg23);
                    }
                });
                this.mRootLayout.setOnClickListener(new View.OnClickListener() {
                    public final void onClick(View arg4) {
                        AppUtil.a(v20.d, BaseApplication.getApplication());
                        SplashAdActivity.this.b(arg23, false);
                    }
                });
                if (!v4) {
//                    goto label_158;
                } else {
                    this.a("splash_ad", "banner_show", arg23.id, v21);
                }
            } else {
                return false;
            }
        } else {
            if (arg23.q != 2) {
//                goto label_158;
            } else {
                boolean v19 = arg23.n == 1 ? true : false;
                v4 = this.mVideoController.playSplashUrl(v20.f, v20.e, null, null, arg23.id, this.mSplashVideoLayout.getWidth(), this.mSplashVideoLayout.getHeight(), v20.a, null, arg23.logExtra, 0, true, v19);
                if (!v4) {
//                goto label_158;
                } else {
                    com.ss.android.b.bb.a().a(System.currentTimeMillis());
                }
            }
        }

        label_158:
        if (v4) {
            this.a(Math.max(arg23.h, arg23.c()));
        }

        return v4;
    }

    protected final void b(AdManager.b arg9, boolean arg10) {
        JSONObject v6;
        if (!this.l) {
            try {
                v6 = new JSONObject();
                if (android.support.design.a.isTextEmpty(arg9.logExtra)) {
//                    goto label_12;
                } else {
                    v6.put("log_extra", arg9.logExtra);
                }
            } catch (Exception v0) {
                v6 = null;
            }

//        label_12:
            String v2 = "splash_ad";
            String v3 = arg10 ? "click" : "banner_click";
            this.a(v2, v3, arg9.id, v6);
            this.a = 1;
            this.a(arg9, true, v6);
        }
    }

    public ImmersedStatusBarHelper.ImmersedStatusBarConfig getImmersedStatusBarConfig() {
        ImmersedStatusBarHelper.ImmersedStatusBarConfig immersedStatusBarConfig = new ImmersedStatusBarHelper
                .ImmersedStatusBarConfig()
                .setStatusBarColor(com.ss.android.article.browser.R.color.transparent);
        immersedStatusBarConfig.mIsUseLightStatusBar = false;
        immersedStatusBarConfig.f = false;
        immersedStatusBarConfig.mFitsSystemWindows = true;
        return immersedStatusBarConfig;
    }

    public void handleMsg(Message message) {
        boolean v0_1;
        if (!this.isViewValid()) {
            return;
        }

        switch (message.what) {
            case 102: {
                this.onBackPressed();
                return;
            }
            case 103: {
                this.onBackPressed();
                return;
            }
            case 104: {
                try {
                    label_10:
                    v0_1 = ((Boolean) message.obj).booleanValue();
                } catch (Exception v0) {
                    v0_1 = false;
                }

                if (!this.l) {
                    if ((v0_1) && !this.k) {
                        this.j = true;
                        return;
                    }

                    this.a(0);
                }
                return;
            }
        }
    }

    public void onActivityResult(int requestCode, int resultCode, Intent intent) {
        if (requestCode == 101) {
            this.mWeakHandler.sendEmptyMessage(102);
        } else {
            super.onActivityResult(requestCode, resultCode, intent);
        }
    }

    public void onBackPressed() {
        if (!this.isFinishing()) {
            this.finish();
        }
    }

    public void onCreate(Bundle savedInstanceState) {
        int v9 = 8;
        int v10 = 2;
        boolean v7 = true;
        com.bytedance.ttstat.a.f(((Activity) this));
        System.currentTimeMillis();
        super.onCreate(savedInstanceState);
        this.h = BaseAppData.inst().cJ;
        if (this.h <= 0) {
            this.onBackPressed();
        } else {
            this.setContentView(com.ss.android.article.browser.R.layout.splash_activity);
            this.mRootLayout = (RelativeLayout) this.findViewById(R.id.root_layout);
            this.mSplashView = (ImageView) this.findViewById(R.id.splash_view);
            this.mBannerView = (ImageView) this.findViewById(R.id.banner_view);
            this.mAdClickSmall = (ImageView) this.findViewById(R.id.ad_click_small);
            this.mAdClick = (LinearLayout) this.findViewById(R.id.ad_click);
            this.mAdIgnore = this.findViewById(com.ss.android.article.browser.R.id.ad_ignore);
            this.mAdSkipLoading = (ImageView) this.findViewById(R.id.ad_skip_loading);
            this.mSplashVideoFrame = (FrameLayout) this.findViewById(R.id.splash_video_frame);
            this.mSplashVideoLayout = (ViewGroup) this.findViewById(R.id.splash_video_layout);
            Intent intent = this.getIntent();
            if (intent == null) {
                this.onBackPressed();
            } else {
                int showTypeCapability = intent.getIntExtra("show_type_capability", 0);
                int v1 = (showTypeCapability & 1) == 1 ? 1 : 0;
                boolean v0_2 = (showTypeCapability & 2) == v10 ? true : false;
                this.i = v0_2;
                if (v1 != 0) {
                    final b v2 = AdManager.getInstance(((Context) this)).c();
                    if (v2 == null) {
                        label_141:
                        v7 = false;
                    } else if (v2.q == 0) {
                        AdManager v0_3 = AdManager.getInstance(((Context) this));
                        if (v2 != null) {
                            h v5 = new h() {

                                public final void a() {
                                    SplashAdActivity.this.a();
                                }

                                public final void b() {
                                    SplashAdActivity.this.a();
                                }
                            };
                            Boolean[] v6 = new Boolean[]{Boolean.valueOf(false)};
                            if (v0_3.tryShowImageSplash(this, v2, this.mBannerView, this.mSplashView, ((pl.droidsonroids.gif.h) v5), v6)) {
                                this.mRootLayout.setBackgroundResource(com.ss.android.article.browser.R.drawable.j0);
                                ImageView v1_1 = this.mAdClickSmall;
                                showTypeCapability = v2.m == v10 ? 0 : v9;
                                v1_1.setVisibility(showTypeCapability);
                                this.mAdClickSmall.setOnClickListener(new View.OnClickListener() {

                                    public final void onClick(View arg4) {
                                        SplashAdActivity.this.a(v2, false);
                                    }
                                });
                                LinearLayout v1_2 = this.mAdClick;
                                showTypeCapability = v2.m == 1 ? 0 : v9;
                                v1_2.setVisibility(showTypeCapability);
                                this.mAdClick.setOnClickListener(new View.OnClickListener() {
                                    public final void onClick(View arg4) {
                                        SplashAdActivity.this.a(v2, false);
                                    }
                                });
                                View v0_4 = this.mAdIgnore;
                                if (v2.n == 1) {
                                    v9 = 0;
                                }

                                v0_4.setVisibility(v9);
                                this.mAdIgnore.setOnClickListener(new View.OnClickListener() {

                                    public final void onClick(View arg3) {
                                        SplashAdActivity.this.a(v2);
                                    }
                                });
                                this.mSplashView.setOnClickListener(new View.OnClickListener() {

                                    public final void onClick(View arg4) {
                                        SplashAdActivity.this.a(v2, true);
                                    }
                                });
                                com.bytedance.ttstat.a.g(this);
                                this.a(Math.max(v2.h, v2.b()));
                                this.mWeakHandler.sendMessageDelayed(this.mWeakHandler.obtainMessage(104, v6[0]), Math.min(v2.h, v2.b()));
                            } else {
                                v7 = false;
                            }
                        } else {
                            v7 = false;
                        }
                    } else {
                        if (v2.q != 3 && v2.q != v10) {
                            v7 = false;
                        } else {
                            v7 = this.b(v2);
                        }
                    }

                    if (v7) {
                        return;
                    }
                } else {
                    if (!this.i) {
//                        goto label_124;
                    } else {
                        this.onBackPressed();
                        return;
                    }
                }

                label_124:
                this.onBackPressed();
            }
        }
    }

    public void onDestroy() {
        super.onDestroy();
        if (this.mAdSkipLoading != null) {
            this.mAdSkipLoading.clearAnimation();
        }
    }

    public void onStop() {
        if (this.mVideoController != null && (this.mVideoController.isVideoVisible())) {
            if (!this.isFinishing()) {
                this.a = 7;
            }

            IVideoController v1 = this.mVideoController;
            boolean v0 = !this.b ? true : false;
            v1.releaseMediaFromSplash(v0, this.a);
        }

        com.bytedance.ttstat.a.h(this);
        super.onStop();
    }
}

